<!DOCTYPE html>
<html>
<meta charset="utf-8">
<meta content="IE=9" http-equiv="x-ua-compatible">
<head th:include="include :: header"></head>

<style>
	#img{
		list-style-type: none;
		margin: 2px;
		/*height: 118px;*/
		float: left;
	}
	.divImg{
		float: left;
		margin: 2px;
		padding: 2px;
		height:108px;
		width:100px;
		border: 1px solid #dcdcdc;
		cursor: pointer;
	}
	.divImgD{
		float: left;
		margin: 2px;
		padding: 2px;
		height:108px;
		width:100px;
		border: 1px solid red;
		cursor: pointer;
	}


    #img_detail{
        list-style-type: none;
        margin: 2px;
        /*height: 118px;*/
        float: left;
    }
    .divImgDetail{
        float: left;
        margin: 2px;
        padding: 2px;
        height:108px;
        width:100px;
        border: 1px solid #dcdcdc;
        cursor: pointer;
    }

</style>
<body class="gray-bg">

	<div class="pull-right">
		<div class="btn-group tool-button">
			<button class="btn btn-primary navbar-btn" type="button" onclick="save()"> 保存</button>
		</div>
	</div>

	<div class="content-wrap">
		<div class="wrapper" style="min-height:500px;">
			<form class="form-horizontal m-t" id="signupForm">
			<!--<form id="addForm" role="form" class="form-horizontal parsley-form" data-parsley-validate-->
				  <!--action="${base!}/platform/goods/goods/addDo" method="post">-->

				<input type="hidden" name="id" id="id" value="">
				<input type="hidden" name="isSubmit" id="isSubmit" value="0">
				<div class="box-tab tabs-left">
					<ul class="nav nav-tabs">
						<li class="active"><a href="#base" data-toggle="tab">基本信息</a>
						</li>
						<!--<li id="kzsx_tab" class="" style="display: none"><a href="#kzsx" data-toggle="tab">扩展属性</a>-->
						<!--</li>-->
						<li id="xxcs_tab" class="" style="display: none"><a href="#xxcs" data-toggle="tab">详细参数</a>
						</li>
						<!--<li class=""><a href="#inf" data-toggle="tab">商品介绍</a>
						</li>-->
					</ul>
					<div class="tab-content text-center">
						<div class="tab-pane fade active in" id="base">
							<div class="row mb10">
								<div class="col-lg-12">
			
									<div class="form-group has-feedback">
										<label for="classId" class="col-sm-2 control-label">商品分类</label>

										<div class="col-sm-8">
											<div class="input-group">
												<input id="classId" type="text" class="form-control" placeholder="请选择商品分类" disabled
													   value=""  required/>

												<span class="input-group-btn">
														<button type="button" class="btn btn-primary" data-toggle="modal"
																data-target="#dialogSelectClass"><i class="ti-plus"></i>选择
														</button>
													</span>

											</div>
											<input type="hidden" name="classId" value="">
										</div>
									</div>
									<div class="form-group">
										<label for="typeId" class="col-sm-2 control-label">商品类型</label>

										<div class="col-sm-8">
											<select id="typeId" name="typeId" class="form-control">
												<option value="">通用商品</option>
												<option th:each="tList : ${typeList}" th:value="${tList.id}" required><span th:text="${tList.name}"></span></option>
											</select>
										</div>
									</div>
									<div class="form-group">
										<label for="brandId" class="col-sm-2 control-label">品牌</label>

										<div class="col-sm-8">
											<select id="brandId" name="brandId" class="form-control">
												<option th:each="bList : ${brandList}" th:value="${bList.id}" required><span th:text="${bList.name}"></span></option>
											</select>
										</div>
									</div>
									<!-- <div class="form-group">
										<label for="warehouseId" class="col-sm-2 control-label">货仓</label>

										<div class="col-sm-8">
											<select id="warehouseId" name="warehouseId" class="form-control">
												<option th:each="wList : ${wareList}" th:value="${wList.id}" required><span th:text="${wList.name}"></span></option>
											</select>
										</div>
									</div> -->
				
									<div class="form-group">
										<label for="name" class="col-sm-2 control-label"><span style="color: red">*</span>商品名称</label>

										<div class="col-sm-8">
											<input type="text" id="name" class="form-control" name="name" data-parsley-required="true"
												   placeholder="商品名称"  data-parsley-maxlength="150"  required>
										</div>
									</div>
									<div class="form-group">
										<label for="title" class="col-sm-2 control-label"><span style="color: red">*</span>商品标题</label>

										<div class="col-sm-8">
											<input type="text" id="title" class="form-control" name="title"
												   placeholder="商品标题"  data-parsley-maxlength="200" required>
										</div>
									</div>

									<div class="form-group">
										<label for="copywriting" class="col-sm-2 control-label"><span style="color: red">*</span>商品文案</label>

										<div class="col-sm-8">
											<textarea type="text" style="height: 120px" id="copywriting" class="form-control" name="copywriting"
												   placeholder="商品文案"  maxlength="300" required></textarea>
										</div>
									</div>
				<!-- 					<div class="form-group">
										<label for="brandId" class="col-sm-2 control-label"><span style="color: red">*</span>品牌</label>

										<div class="col-sm-8">
											<select id="brandId" name="brandId" class="form-control" required>
											</select>
										</div>
									</div> -->

									<div class="form-group" >
										<label for="file_upload" class="col-sm-2 control-label"><span style="color: red">*</span>商品相册</label>

										<div class="col-sm-8" >
											<div id="queue"></div>
											<div >
												<input id="file_upload" name="file_upload" type="file" multiple="true" class="btn btn-primary">

											</div>
											<div id="img">
											</div>
										</div>
									</div>

                                    <div class="form-group">
                                        <label for="file_upload_detail" class="col-sm-2 control-label" ><span style="color: red">*</span>商品详情图片</label>

                                        <div class="col-sm-8">
                                            <div id="queue_detail"></div>
                                            <div >
                                                <input id="file_upload_detail" name="file_upload_detail" type="file" multiple="true">
                                            </div>
                                            <div id="img_detail">
                                            </div>
                                        </div>
                                    </div>
									<div id="sp_new" style="display: none">
									</div>
									<!--以下为开启规格隐去页面-->
									<div id="sp">

										<div class="form-group">
											<label for="price" class="col-sm-2 control-label"><span style="color: red">*</span>价格/积分</label>
											<div class="col-sm-8">
												<input type="text" id="price" class="form-control" style="width: 120px;" name="price" placeholder="普通商品为价格积分商品为积分(0.00)" onkeyup=checkNum(this)  required>
												<input type="hidden" name="lvprice" value="[]">
											</div>
										</div>
										<!-- <div class="form-group">
											<label for="priceC" class="col-sm-2 control-label"><span style="color: red">*</span>初级会员价格</label>
											<div class="col-sm-8">
												<input type="text" id="priceC" class="form-control" style="width: 170px;" name="priceC" placeholder="初级会员价格(0.00)"  required onkeyup=checkNum(this)>
											</div>
										</div>
										<div class="form-group">
											<label for="priceZ" class="col-sm-2 control-label"><span style="color: red">*</span>中级会员价格</label>

											<div class="col-sm-8">
												<input type="text" id="priceZ" class="form-control" style="width: 170px;" name="priceZ" placeholder="中级会员价格(0.00)"  required onkeyup=checkNum(this)>

											</div>
										</div>
										<div class="form-group">
											<label for="priceG" class="col-sm-2 control-label"><span style="color: red">*</span>高级会员价格</label>

											<div class="col-sm-8">
												<input type="text" id="priceG" class="form-control" style="width: 170px;" name="priceG" placeholder="高级会员价格(0.00)"  required onkeyup=checkNum(this)>

											</div>
										</div>

										<div class="form-group">
											<label for="rebateOne" class="col-sm-2 control-label"><span style="color: red">*</span>初级分销自反金额</label>

											<div class="col-sm-8">
												<input type="text" id="rebateOne" class="form-control" style="width: 170px;" name="rebateOne" placeholder="初级分销自反金额(0.00)"  required onkeyup=checkNum(this)>

											</div>
										</div>
										<div class="form-group">
											<label for="rebateTwo" class="col-sm-2 control-label"><span style="color: red">*</span>高级分销自反金额</label>

											<div class="col-sm-8">
												<input type="text" id="rebateTwo" class="form-control" style="width: 170px;" name="rebateTwo" placeholder="高级分销自反金额(0.00)"  required onkeyup=checkNum(this)>

											</div>
										</div>
 -->										<div class="form-group">
											<label for="sku" class="col-sm-2 control-label">SKU货号</label>

											<div class="col-sm-8">
												<input type="text" id="sku" value="" class="form-control" name="sku" placeholder="货号(不填则自动生成)">

											</div>
										</div>

										<div class="form-group">
											<label for="weight" class="col-sm-2 control-label">重量</label>

											<div class="col-sm-8">
												<input type="text" id="weight" class="form-control" style="width: 170px;" name="weight" placeholder="千克(1kg)">

											</div>
										</div>
									<div class="form-group" id="postSizeDiv">
										<label class="col-sm-2 control-label">运费方式：</label>
										<div class="col-sm-8" style="float: left;text-align: left">
											<input type="radio" name="postSize" value="0" checked="checked"/>
											通用
											<input type="radio" name="postSize" value="1" />
											模板
											<input type="radio" name="postSize" value="2" />
											包邮
										</div>
									</div>
										<div class="form-group" id="postFeeDiv">
											<label for="postFee" class="col-sm-2 control-label"><span style="color: red">*</span>通用运费</label>

											<div class="col-sm-8">
												<input type="text" id="postFee" class="form-control" style="width: 300px;" name="postFee" placeholder="请填通用邮费"  required onkeyup=checkNum(this)>

											</div>
										</div>
										<div class="form-group">
											<label for="stock" class="col-sm-2 control-label"><span style="color: red">*</span>库存</label>

											<div class="col-sm-8">
												<input type="text" id="stock" class="form-control" style="width: 170px;" name="stock" placeholder="库存">

											</div>
										</div>
						 				<div class="form-group">
											<label for="buyMin" class="col-sm-2 control-label">每单最小购买量</label>

											<div class="col-sm-8">
												<input type="text" id="buyMin" class="form-control" style="width: 170px;" value="1" name="buyMin" placeholder="默认为1">

											</div>
										</div>
										<div class="form-group">
											<label for="buyMax" class="col-sm-2 control-label">每单最大购买量</label>

											<div class="col-sm-8">
												<input type="text" id="buyMax" class="form-control" style="width: 170px;" value="100"  name="buyMax" placeholder="默认为100">
											</div>
										</div>
										<div class="form-group" id="gg" style="display: none">
											<label for="gg" class="col-sm-2 control-label">规格</label>

											<div class="col-sm-8">
												<button id="specBtn" class="btn btn-primary" style="float: left;" type="button">开启规格</button>
											</div>
										</div>
									</div>
									<!--以上为开启规格隐去页面-->

									
							<!-- 		<div class="form-group">
										<label for="allNumber" class="col-sm-2 control-label">商品最大购买量</label>

										<div class="col-sm-8">
											<input type="text" id="allNumber" class="form-control" style="width: 170px;" value="100"  name="allNumber" placeholder="默认为100">
										</div>
									</div> -->
									<div class="form-group">
										<label for="unit" class="col-sm-2 control-label">计量单位</label>

										<div class="col-sm-8">
											<input id="unit" type="text" class="form-control" style="width: 170px;" name="unit" placeholder="计量单位">

										</div>
									</div>
									<div class="form-group">
										<label for="numSale" class="col-sm-2 control-label">总销量</label>

										<div class="col-sm-8">
											<input id="numSale" type="text" class="form-control" style="width: 170px;" name="numSale" placeholder="总销量">

										</div>
									</div>
									<!-- <div class="form-group" id='divMessage'>
										<label for="message" class="col-sm-2 control-label">是否留言</label>

										<div id="message" class="col-sm-8" style="float: left;text-align: left">
											<input type="radio" name="message" value="0" checked>留言
											<input type="radio" name="message" value="1" >不留言

										</div>
									</div> -->
									<input type="hidden" name="message" id="message" value="1">
									<input type="hidden" name="isvip" id="isvip" value="0">
									<!-- <div class="form-group">
										<label class="col-sm-2 control-label">是否参与会员任务：</label>
										<div class="col-sm-8" style="float: left;text-align: left">
											<input type="radio" name="isvip" value="0" />
												不参与
											<input type="radio" name="isvip" value="1" />
												参与
										</div>
									</div> -->

									<!-- <div class="form-group">
										<label class="col-sm-2 control-label">会员等级限制：</label>
										<div class="col-sm-8" style="float: left;text-align: left">
												<input type="checkbox" name="vipLevel0" value="0" />
												游客
												<input type="checkbox" name="vipLevel0" value="1" />
												初级会员
												<input type="checkbox" name="vipLevel0" value="2" />
												中级会员
												<input type="checkbox" name="vipLevel0" value="3" />
												高级会员
												<input type="checkbox" name="vipLevel0" value="4" />
												初级分销
												<input type="checkbox" name="vipLevel0" value="5" />
												高级分销
										</div>
									</div> -->
									<!--<div class="form-group" id='divRecommend'>
										<label for="recommend" class="col-sm-2 control-label">推荐种类</label>

										<div id="recommend" class="col-sm-8" style="float: left;text-align: left">
											<input type="radio" name="recommend" value="1" >推荐
											<input type="radio" id="notRecommend" name="recommend" value="0" checked>不推荐

										</div>
									</div>-->
									<div class="form-group">
										<label for="disabled1" class="col-sm-2 control-label">是否上架</label>

										<div id="disabled1" class="col-sm-8" style="float: left;text-align: left">
											<input type="radio" name="disabled" value="0" checked>上架
											<input type="radio" name="disabled" value="1">下架

										</div>
									</div>

									<!--<div class="form-group">
										<label for="recomSy" class="col-sm-2 control-label">首页推荐</label>

										<div id="recomSy" class="col-sm-8" style="float: left;text-align: left">
											<input type="radio" name="recomSy" value="0" checked>不推荐
											<input type="radio" name="recomSy" value="1">推荐
										</div>
									</div>

									<div class="form-group">
										<label for="recomXq" class="col-sm-2 control-label">详情推荐</label>

										<div id="recomXq" class="col-sm-8" style="float: left;text-align: left">
											<input type="radio" name="recomXq" value="0" checked>不推荐
											<input type="radio" name="recomXq" value="1">推荐
										</div>
									</div>

									<div class="form-group">
										<label for="recomGwc" class="col-sm-2 control-label">购物车推荐</label>

										<div id="recomGwc" class="col-sm-8" style="float: left;text-align: left">
											<input type="radio" name="recomGwc" value="0" checked>不推荐
											<input type="radio" name="recomGwc" value="1">推荐
										</div>
									</div>-->

								</div>
							</div>
						</div>
						<!--<div class="tab-pane fade" id="kzsx">-->

						<!--</div>-->
						<div class="tab-pane fade" id="xxcs">
						</div>
						<div class="tab-pane fade" id="inf">
							<div class="row mb10">
								<div class="col-lg-12" style="text-align:left">
									<textarea id="note" name="note" style="width:100%;height:200px;"></textarea>
								</div>
							</div>
						</div>
				</div>
				<div class="col-lg-3"></div>
				<input id="hasSpec" name="hasSpec" type="hidden" value="0">
				<input id="products" name="products" type="hidden" value="">
				<input id="images" name="images" type="hidden" value="">
				<input id="imagesDetail" name="imagesDetail" type="hidden" value="">
				<input id="spec_values" name="spec_values" type="hidden" value="[]">
				<input id="prop_values" name="prop_values" type="hidden" value="[]">
				<input id="param_values" name="param_values" type="hidden" value="[]">
				<input id="vipLevel" name="vipLevel" type="hidden" value="0">
			</div>
			</form>

		</div>
	</div>
	<!-- 选择上级 -->
	<div id="dialogSelectClass" class="modal fade bs-modal-sm" tabindex="-1" role="dialog" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
					<h4 class="modal-title">选择分类</h4>
				</div>
				<div class="modal-body">
					<div class="row">
						<div class="col-xs-12">
							<div id="jsTreeClass" class="demo"></div>
						</div>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">取 消</button>
					<button type="button" class="btn btn-primary" onclick="selectClass()">确认选择</button>
				</div>
			</div>
		</div>
	</div>

	<div id="specHtml"></div>
	<div id="dialogSpec"  hidden>
		<div  style="min-width: 600px;" >
			<div  style="min-height: 300px;">
				<div class="row">
					<div class="col-xs-12" style="float: left" >

						<div class="spec" th:each="spList : ${specList}" style="float: left;padding-right: 10px;" th:attr="data-spec-name=${spList.spec.name},data-spec-type=${spList.spec.type},data-spec-id=${spList.spec.id}"   >
							<span class="h5 mb10" style="float: left"><input class="specChkAll" type="checkbox"><strong th:text="${spList.spec.name}"></strong></span>
							<div style="float: left;padding-left: 20px;">

								<div class="vl" th:each="sVList : ${spList.specValList}" >
									<input th:id="${sVList.specValueId}" type="checkbox" th:value="${sVList.specValueId}"
										   th:title="${sVList.specValText}"><span th:text="${sVList.specValText}"></span>
								</div>

							</div>
						</div>


					</div>
					<div class="col-xs-12" style="padding-top: 5px;height: 45px;">
						<button id="doProduct" type="button" class="btn btn-primary btn-sm">生成所有货品</button>
					</div>
					<div style="width: 100%;text-align: center;margin-top: 10px;">
						<table id="plist" class="table table-bordered table-striped table-condensed" style="width: 95%;margin: 20px;">
							<thead>
							<tr>
								<th>规格值</th>
								<th>货号</th>
								<th class="numeric">上架</th>
								<th class="numeric">库存</th>
								<th class="numeric">最小购买</th>
								<th class="numeric">最大购买</th>
								<th class="numeric">价格</th>
								<!-- <th class="numeric">初级会员价</th>
								<th class="numeric">中级会员价</th>
								<th class="numeric">高级会员价</th> -->
								<!-- <th class="numeric">运费</th> -->
								<!-- <th class="numeric">初级分销自反</th>
								<th class="numeric">高级分销自反</th> -->
								<th class="numeric">重量(g)</th>
								<th class="numeric">默认货品</th>
								<th class="numeric">操作</th>
							</tr>
							</thead>
							<tbody>
							</tbody>
						</table>
					</div>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">取 消</button>
				<button id="dialogSpecOK" type="button" class="btn btn-primary" data-loading-text="保存...">保 存</button>
			</div>

		</div>
	</div>

	<div th:include="include::footer"></div>
    <link rel="stylesheet" href="/js/plugins/uploadifive/uploadifive.css">
    <script src="/js/plugins/uploadifive/jquery.uploadifive.min.js"></script>
    <script src="/js/jquery.sortable.js"></script>
    <script src="/js/plugins/sorttable/Sortable.min.js"></script>
    <script src="/js/plugins/validate/jquery.validate.min.js"></script>
	<script src="/js/plugins/validate/messages_zh.min.js"></script>
	<script src="/js/appjs/wx/goodsSpike/adddate.js"></script>
    
	<script type="text/javascript" src="/js/appjs/wx/goodsGoods/add.js">
	</script>
</body>
</html>
